/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.bo;

import org.ipti.br.tag.dao.ConfigurationsFacade;
import org.ipti.br.tag.entity.Configurations;
import java.io.Serializable;
import java.util.List;
import javax.ejb.Stateless;
import javax.inject.Inject;

/**
 *
 * @author root
 */
@Stateless
public class ConfigurationsBO implements Serializable {

    @Inject
    private ConfigurationsFacade configurationsDAO;

    public ConfigurationsFacade getConfigurationsDAO() {
        return configurationsDAO;
    }

    public Configurations configurationsPerName(String name) {
        return getConfigurationsDAO().configurationsPerName(name);
    }

    public void create(Configurations configurations) {
        getConfigurationsDAO().create(configurations);
    }

    public void edit(Configurations configurations) {
        getConfigurationsDAO().edit(configurations);
    }

    public void remove(Configurations configurations) {
        getConfigurationsDAO().remove(configurations);
    }

    public Configurations find(Object id) {
        return getConfigurationsDAO().find(id);
    }

    public List<Configurations> findAll() {
        return getConfigurationsDAO().findAll();
    }
    
    public Long getSerialNumber(){
        return Long.parseLong(getConfigurationsDAO().configurationsPerName("serialnumber").getVal());
    }
}
